package hu.bme.mit.inf.eclipse.v37zen.awesome.diagram.edit.parts;

import hu.bme.mit.inf.eclipse.v37zen.awesome.diagram.part.AwesomeVisualIDRegistry;

import org.eclipse.gef.EditPart;
import org.eclipse.gef.EditPartFactory;
import org.eclipse.gef.tools.CellEditorLocator;
import org.eclipse.gmf.runtime.diagram.ui.editparts.ITextAwareEditPart;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tooling.runtime.directedit.locator.CellEditorLocatorAccess;

/**
 * @generated
 */
public class AwesomeEditPartFactory implements EditPartFactory {

	/**
	 * @generated
	 */
	public EditPart createEditPart(EditPart context, Object model) {
		if (model instanceof View) {
			View view = (View) model;
			switch (AwesomeVisualIDRegistry.getVisualID(view)) {

			case AwesomeEditPart.VISUAL_ID:
				return new AwesomeEditPart(view);

			case DesktopEditPart.VISUAL_ID:
				return new DesktopEditPart(view);

			case Desktop2EditPart.VISUAL_ID:
				return new Desktop2EditPart(view);

			case MenuEditPart.VISUAL_ID:
				return new MenuEditPart(view);

			case MenuNameEditPart.VISUAL_ID:
				return new MenuNameEditPart(view);

			case MenuitemEditPart.VISUAL_ID:
				return new MenuitemEditPart(view);

			case MenuitemLabelEditPart.VISUAL_ID:
				return new MenuitemLabelEditPart(view);

			case TopBoxEditPart.VISUAL_ID:
				return new TopBoxEditPart(view);

			case BottomBoxEditPart.VISUAL_ID:
				return new BottomBoxEditPart(view);

			case LeftBoxEditPart.VISUAL_ID:
				return new LeftBoxEditPart(view);

			case RightBoxEditPart.VISUAL_ID:
				return new RightBoxEditPart(view);

			case DesktopMenusCompartmentEditPart.VISUAL_ID:
				return new DesktopMenusCompartmentEditPart(view);

			case DesktopTopBoxCompartmentEditPart.VISUAL_ID:
				return new DesktopTopBoxCompartmentEditPart(view);

			case DesktopBottomBoxCompartmentEditPart.VISUAL_ID:
				return new DesktopBottomBoxCompartmentEditPart(view);

			case DesktopRightBoxCompartmentEditPart.VISUAL_ID:
				return new DesktopRightBoxCompartmentEditPart(view);

			case DesktopLeftBoxCompartmentEditPart.VISUAL_ID:
				return new DesktopLeftBoxCompartmentEditPart(view);

			case MenuMenuItemsCompartmentEditPart.VISUAL_ID:
				return new MenuMenuItemsCompartmentEditPart(view);

			case MenuitemSubmenuEditPart.VISUAL_ID:
				return new MenuitemSubmenuEditPart(view);

			}
		}
		return createUnrecognizedEditPart(context, model);
	}

	/**
	 * @generated
	 */
	private EditPart createUnrecognizedEditPart(EditPart context, Object model) {
		// Handle creation of unrecognized child node EditParts here
		return null;
	}

	/**
	 * @generated
	 */
	public static CellEditorLocator getTextCellEditorLocator(
			ITextAwareEditPart source) {
		return CellEditorLocatorAccess.INSTANCE
				.getTextCellEditorLocator(source);
	}

}
